package org.example.controller;

import io.swagger.annotations.Api;
import org.common.controller.base.BaseController;
import org.common.controller.base.OR;
import org.common.model.ro.UserRO;
import org.example.service.UserService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
@Api(value = "用户管理", tags = {"用户管理"})
public class UserController extends BaseController {

    @Resource
    UserService userService;

    @PostMapping("/register")
    public ResponseEntity<OR<Void>> register(@RequestBody UserRO ro){
        userService.register(ro);
        return success();
    }
}
